#include "Tank.h"
#include <string.h>
#include <cstdlib>
#include <cmath>
#include <fstream>
#include <list>
using namespace std;

#pragma once

struct Item{
       int F;
       int G;
       int H;
       short row;
       short col;
       Item(){}
       Item(const Item& a){
              F = a.F;
              G = a.G;
              H = a.H;
              row = a.row;
              col = a.col;
                  }
       };

extern DataForAI gdata;
extern short destination[MAX_TANK_NUM];  //tank的当前目标=矿号+1
extern short resourceNeedCapture[MAX_SOURCE_NUM+1];//未被锁定的资源
//extern Point tankHistoryLastStep[MAX_TANK_NUM]; //tank上一步
//extern Point tankHistoryNextStep[MAX_TANK_NUM];//tank下一步
//extern Point tankHistoryNextStep4[MAX_TANK_NUM];
//extern Point tankHistoryLastStep4[MAX_TANK_NUM];
extern short tankHistoryNextStep_Round;
extern int NearestTankToSource[MAX_SOURCE_NUM];  //tank_ID +1
extern int NearestTankToSourceDist[MAX_SOURCE_NUM];
extern Point tankHistoryLocation[MAX_TANK_NUM];
extern bool tankHistoryOderIsFIRE[MAX_TANK_NUM];
extern short tankHistoryLocationStaticTimes[MAX_TANK_NUM];
extern ofstream fout;
extern int roundCount;
extern bool Field[MAP_HEIGHT][MAP_WIDTH];

struct Choice {
public :
   Choice();
   Order order;
   int takeSourceStep;
   bool willDie;
   bool willKill;
   int destination;
   int __weight;
   char __type;
};
struct PathFindingResult{
       Point nextPoint;
       int takeSourceStep;
       };

extern bool willDieAtPoint(int row, int col, int life);

extern list<Choice> makeChoiceByBeaten(DataForAI& data);
extern list<Choice> makeChoiceByAttack(DataForAI& data);
extern list<Choice> makeChoiceByFinding(DataForAI& data);
extern list<Choice> makeChoiceByFinding2(DataForAI& data);
extern list<Choice> makeChoiceByDefend(DataForAI& data);
